package com.hycat.mail.ware.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 库存工作单
 * 
 * @author lzhycat
 * @email 2680628835@qq.com
 * @date 2022-07-16 20:30:08
 */
@Data
@TableName("wms_ware_order_task_detail")
public class WareOrderTaskDetailEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@TableId
	private Long id;
	/**
	 * sku_id
	 */
	private Long skuId;
	/**
	 * sku_name
	 */
	private String skuName;
	/**
	 * 购买个数
	 */
	private Integer skuNum;
	/**
	 * 锁定库存快照表id
	 */
	private Long taskId;
	/**
	 * wareSkuId
	 */
	private Long wareSkuId;
	/**
	 * 锁定状态(0——已锁定 2——已解锁)
	 */
	private int lockStatus;

	public static WareOrderTaskDetailEntity from(WareSkuEntity wareSkuEntity, Integer currentStock) {
		WareOrderTaskDetailEntity entity = new WareOrderTaskDetailEntity();
		entity.setSkuId(wareSkuEntity.getSkuId());
		entity.setSkuName(wareSkuEntity.getSkuName());
		entity.setSkuNum(currentStock);
		entity.setLockStatus(0);
		return entity;
	}

}
